define(()=>{
    return function (data, box){
        let str = "";
        data.forEach(val=>{
            str += `<div class="box" index="${val.proId}">
                        <a href="./detail.html?id=${val.proId}">
                            <img src="${val.img}" alt="">
                            <p>${val.proName}</p>
                            <p>￥${val.price}</p>
                        </a>
                        <button class='add'>加入购物车</button>
                    </div>`
        })
        box.innerHTML = str;
    }
})